Skip to content

Add comments to methods in IWebHookService#15151

Merged
Zeegaan merged 2 commits intoumbraco:v13/devfrom
bjarnef:feature/webhook-service-comments
Nov 7, 2023
Merged

Add comments to methods in IWebHookService#15151
Zeegaan merged 2 commits intoumbraco:v13/devfrom
bjarnef:feature/webhook-service-comments

Conversation

@bjarnef
Copy link
Copy Markdown
Contributor

@bjarnef bjarnef commented Nov 6, 2023

Prerequisites

  • I have added steps to test this contribution in the description below

Description

Added comments to methods in new IWebHookService.

Not sure if create, update and delete should have int userId = Constants.Security.SuperUserId param like many others services, e.g. IDataTypeService:

void Save(IDataType dataType, int userId = Constants.Security.SuperUserId);

which is used for Audit():

Audit(AuditType.Save, userId, dataType.Id);

while looking into supporting Webhooks in management API, I noticed other services pass in CurrentUserKey(_backOfficeSecurityAccessor), so maybe we need this later anyway?
https://github.com/umbraco/Umbraco-CMS/pull/15147/files#diff-33a00493a31cf8daad754645a3ba59e063c24b6aa7d9a89fc24a3226237f6a6eR35

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 6, 2023

Hi there @bjarnef, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@bjarnef
Copy link
Copy Markdown
Contributor Author

bjarnef commented Nov 7, 2023

@Zeegaan while looking at webhooks in #15147 I think we could use a GetMultipleAsync(IEnumerable<Guid> ids).

similar to languages:

public async Task<IEnumerable<ILanguage>> GetMultipleAsync(IEnumerable<string> isoCodes) => (await GetAllAsync()).Where(x => isoCodes.Contains(x.IsoCode));

@Zeegaan
Copy link
Copy Markdown
Member

Zeegaan commented Nov 7, 2023

Hmm I considered this when doing the original implementation, but I'm not really sure where it would be useful to get multiple by ids 🤔 If you can think of a use-case that would use this, then I am open to implement it! 💪

@Zeegaan
Copy link
Copy Markdown
Member

Zeegaan commented Nov 7, 2023

LGTM 🚀

@Zeegaan Zeegaan merged commit 90ddd63 into umbraco:v13/dev Nov 7, 2023
@bjarnef bjarnef deleted the feature/webhook-service-comments branch November 7, 2023 10:24
@bjarnef
Copy link
Copy Markdown
Contributor Author

bjarnef commented Nov 7, 2023

@Zeegaan the multiple by ids, was because I looked into the management API in v14, which had an Items endpoint, but maybe we don't need if for webhooks 🤷‍♂️

@Zeegaan
Copy link
Copy Markdown
Member

Zeegaan commented Nov 7, 2023

No hopefully we should not need those for webhooks 🙈

@bjarnef
Copy link
Copy Markdown
Contributor Author

bjarnef commented Nov 7, 2023

Do we need int userId = Constants.Security.SuperUserId as well like on IDataTypeService - it seems it used for audits, but not sure about audits for webhooks?
Maybe it could be useful the multiple backoffice users has access to create webhooks and then also can be created from code (super user).

@Zeegaan
Copy link
Copy Markdown
Member

Zeegaan commented Nov 7, 2023

For now no, its used for an Audit trail, but we don't need that for Webhooks. This should be more in line with `ILanguageService`` from v14 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants